package com.kt.common.clazz.interface1.extensionfun

class ExtensionList {

    fun <T>MutableList<T>.swap(index1: Int, index2: Int) {
        if (this.size <= index1 || this.size <= index2) return
        val temp = this[index1]
        this[index1] = this[index2]
        this[index2] = temp
    }

    fun <T> MutableList<T>.println() {
        if (this.isNullOrEmpty()) {
            println("list is null")
            return
        }
        this.forEach {
            println(it)
        }
    }
}